<?php

namespace Core\Widget;
use Logger;

class Widget_WidgetNotFound extends  WidgetAbstract{

    public function form()
    {

        $html = '<h3>Lỗi phát sinh. Không load được block editor</h3>';
        $javascript = '<script type="text/javascript">

            function doAddWidget(){


                return { widgetName:"WidgetNotFound"};

            }
        </script>';
        return $html.$javascript;
    }

    public function render($blockInstanceItem)
    {
        return '<h3>Không tìm thấy block</h3>';

    }

    public function save($allParams)
    {
        Logger::debug('nothing to save');
    }

    public function form_update($blockInstance_Item, $blockClass_Item)
    {
        $html = '<h3>Lỗi phát sinh. Không load được block editor</h3>';
        $javascript = '<script type="text/javascript">

            function doUpdateWidget(){
                return { widgetName:"WidgetNotFound"};

            }
        </script>';
        return $html.$javascript;
    }

    public function preview($allParams)
    {
        // TODO: Implement preview() method.
    }
    public function form_content($blockInstance_Item)
    {

    }

    public function saveContent($allParams)
    {
        // TODO: Implement saveContent() method.
    }

    public function getProgramCode()
    {
        return 'WidgetNotFound';
    }
}